{include file="public/header" /}

<div class="layui-layout layui-layout-admin">
  {include file="public/left" /}

  <div class="layui-body">
  <div class="layui-tab layui-tab-brief" lay-filter="tab">
    <ul class="layui-tab-title">
      <li class="layui-this"><a href="{:url('Role/index')}">角色列表</a></li>
      <li><a href="{:url('Role/add')}">角色添加</a></li>
    </ul>
    <div class="layui-tab-content">
      <div class="layui-tab-item layui-show">
        <table class="layui-table">
          <thead>
          <tr>
            <th>序号|ID</th>
            <th>角色名称</th>
            <th style="width: 700px;">管理栏目</th>
            <th>状态</th>
            <th>操作</th>
          </tr>
          </thead>
          <tbody>
          {volist name="list" id="v"}
            <tr>
              <td>{$i}|{$v['id']}</td>
              <td>{$v.role_name}</td>
              <td>{if condition="$v['role_auth_ids'] neq ''"}{:get_role_auth_name($v['role_auth_ids'])}{else/}所有栏目{/if}</td>
              <td>
                <?php if($v['status']==1){?>
                <a href='{:get_url($v['id'],'Role','Audit')}'><i class='fa fa-toggle-on' title="点击关闭"></i></a>
                <?php }else{?>
                <a href='{:get_url($v['id'],'Role','Audit')}'><i class='fa fa-toggle-off' title="点击开启"></i></a>
                <?php }?>
              </td>
              <td>
                <a href='{:get_url($v['id'],'Role','Add')}'  class='layui-btn layui-btn-xs'>修改</a>
                <a href='{:get_url($v['id'],'Role','Del')}' onclick='return confirm("您确定要删除角色么？")' class='layui-btn layui-btn-xs layui-btn-danger' title='删除'>删除</a>
              </td>
            </tr>
          {/volist}
          </tbody>
        </table>
        <div class="page">
          {$list->render()}
        </div>
      </div>
    </div>
  </div>
</div>

  {include file="public/footer" /}

</div>

</body>
</html>
